//
//  IndexViewController.m
//  eBook
//
//  Created by 何 伟楠 on 14-5-6.
//  Copyright (c) 2014年 zhan. All rights reserved.
//

#import "IndexViewController.h"

@interface IndexViewController ()

@end

@implementation IndexViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)chapterSelectAction:(id)sender
{
    UIButton *btn = (UIButton *) sender;
    chapter = btn.tag;
    
    ContentViewController *contentVC = [self.storyboard instantiateViewControllerWithIdentifier:@"ContentVC"];
    [contentVC setChapter:chapter andFeature:1 andPage:1 andAllPages:5 andFeatureCount:3];
    
    
    if (!XAppDelegate.stackVC)
    {
        XAppDelegate.stackVC = [[PSStackedViewController alloc] initWithRootViewController:contentVC];
    }
    
    [self presentViewController:XAppDelegate.stackVC animated:YES completion:nil];
}

#pragma mark - Segue

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    NSLog(@"prepareForSegue");
    
}





















@end
